VxAlignBaseLines


Set the top offset of the source widget to line up with the baseline of the target widget

Syntax

VxAlignBaseLines targetWidget sourceWidget [currentOffset]

Description

Given two widgets which have been created with the source widget connected via -alignTop to the target widget, this sets the top offset of the source widget so that its baseline lines up with the target widget's baseline.

Options

targetWidget
The widget you are aligning to.

sourceWidget
The widget that will be adjusted.

currentOffset
Any top offset the target widget already has which must be taken into account. (This is optional; the default is 0.)

Example

The following code produces a PushButton and a Text widget with all text aligned.

set app [VtOpen demo]

set fn [VtFormDialog $app.fn -title "VxAlignBaseLines Demo" ]

set but [VtPushButton $fn.but \
	-leftSide FORM \
	-label "Apples"]

set text [VtText $fn.text \
	-rightSide FORM \
	-leftSide but \
	-alignTop but 
	-value "Pears"]

VxAlignBaseLines $but $text

VtShow $fn
VtMainLoop

This code produces the following: